package com.sunny.cloudsleuthzipkin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * test链路跟踪
 *
 * 访问zipkin页面，需要先调用一次服务
 * @author Sunny
 * @date 2019/11/12 下午6:05
 */
@RestController
public class ServiceOneController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/one")
    public String callHome1() {
        return restTemplate.getForObject("http://two:9601/info2", String.class);
    }

    @RequestMapping("/info1")
    public String info1() {
        return "i'm service-one";
    }
}
